<template>
  <view class="md-go-ai">
    <image :src="oneTu" class="logo" @click="handleGo" v-if="isShowIcon"></image>
  </view>
</template>

<script setup lang="ts">
import oneTu from '@/static/images/oneTu.png';
import { onLoad } from '@dcloudio/uni-app';
import { ref } from 'vue';

const isShowIcon = ref(false);

const handleGo = () => {
  uni.navigateTo({
    url: '/pages/other/ai/tourist-guide',
  });
};

onLoad(() => {
  const configInfo = uni.getStorageSync('configInfo') ? JSON.parse(uni.getStorageSync('configInfo')) : '';
  if (configInfo) {
    // is_show_bot 1显示 2不显示
    isShowIcon.value = configInfo.is_show_bot == 1;
  }
});
</script>

<style lang="scss">
.md-go-ai {
  .logo {
    position: fixed;
    right: 20rpx;
    top: 60%;
    width: 102rpx;
    height: 85rpx;
    z-index: 10;
  }
}
</style>
